<template>
  <div class="app-container">
    <el-form ref="placeCodeForm" v-loading="formLoading" :rules="rules" :model="form" label-position="top">
      <el-row type="flex" :gutter="20">
        <el-col :span="24">
          <el-form-item label="拒绝理由" prop="remarks" style="width: 400px">
            <el-input v-model="form.remarks" placeholder="请输入拒绝理由" clearable  />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
import {toExaminePublishApi} from "@/api/companyCode";

export default {
  name: 'PlaceCodeDetail',
  data(){
    return{
      time:[],
      form: {
        id: null,
        remarks: '',
      },
      rules: {
        remarks: [{ required: true, trigger: 'blur', message: '请输入拒绝理由' }]
      },
      formLoading: false,
    }
  },
  props:['id','closeDialog'],
  methods:{
    submit(){
      this.$refs.placeCodeForm.validate(valid => {
        if (valid) {
          const loading=this.$loading({
            text:'提交中'
          })

          toExaminePublishApi({id: this.id,remarks: this.form.remarks,stateType: 2}).then((res)=>{
            this.$message.success('提交成功');
            this.closeDialog(0);
          }).catch(()=>{
            this.$message.error('提交失败');
          }).finally(()=>{
            loading.close();
          })
        } else {
          return false
        }
      })
    },
  },
  mounted() {

  },
}
</script>
<style scoped>
/*
*让select撑开
*/
.el-select,.el-cascader{
  display: block;
}
</style>
